//
//  SedcondDetailTableViewCell.m
//  LANGirl
//
//  Created by 杨泓晔 on 16/3/7.
//  Copyright © 2016年 LanJue. All rights reserved.
//

#import "SedcondDetailTableViewCell.h"

@interface SedcondDetailTableViewCell ()
@property (nonatomic,retain)UIImageView *myBackimageView;/**<背景白板*/
@property (nonatomic,retain)UIImageView *headImgeView;/**<头像*/
@property (nonatomic,retain)UILabel *nameL;/**<*/
@property (nonatomic,retain)UILabel *YHlabel;/**<张三件丰*/
@property (nonatomic,retain)UILabel *GSlabel;/**<公司名*/
@property (nonatomic,retain)UILabel *DDlabe;/**<地址*/
@end

@implementation SedcondDetailTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}
- (void)createView{
    self.backgroundColor = LV;
    
    
    
    
    self.myBackimageView = [UIImageView new];
    [self.contentView addSubview:self.myBackimageView];
    self.myBackimageView.backgroundColor = [UIColor whiteColor];
    //裁掉边框
    self.myBackimageView.layer.masksToBounds = YES;
    //设置半径
    self.myBackimageView.layer.cornerRadius = 6 *AUTO_HEIGHT;
    
    
    [self.myBackimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView.mas_top).offset(10);
        make.left.mas_equalTo(self.contentView.mas_left).offset(14);
        make.bottom.mas_equalTo(self.mas_bottom).offset(-5);
        make.width.mas_equalTo(SCREEN_WIDTH - 14 * 2);
    }];
    self.myBackimageView.layer.borderWidth=1.0;
    self.myBackimageView.layer.borderColor=[[UIColor colorWithRed:0.819 green:0.808 blue:0.789 alpha:0.530]CGColor];
    
    
    
    
    
    
    self.headImgeView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 300 * AUTO_HEIGHT, 320 * AUTO_WIDTH, 20 * AUTO_HEIGHT)];
    self.headImgeView.alpha =0.4;
    self.headImgeView.backgroundColor = [UIColor magentaColor];
    //    [self.view addSubview:imageViewLin];
    //            _imageViewLin2.backgroundColor = [UIColor redColor];
    [self.myBackimageView addSubview:self.headImgeView];
    [self.headImgeView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.myBackimageView).offset(15.00*HEIGHT);
        make.left.equalTo(self.myBackimageView).offset(18*WEIGHT);
       // make.right.equalTo(self.myBackimageView).offset(0.00*WEIGHT);
        make.size.mas_equalTo(CGSizeMake(60*WEIGHT,60*HEIGHT));
    }];
    self.headImgeView.layer.masksToBounds = YES;
    //设置半径
    self.headImgeView.layer.cornerRadius = 30 *AUTO_HEIGHT;

    /*
    UIGraphicsBeginImageContext(imageViewLin0.frame.size);   //开始画线
    [imageViewLin0.image drawInRect:CGRectMake(0, 3.00*HEIGHT, imageViewLin0.frame.size.width, imageViewLin0.frame.size.height)];
    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);  //设置线条终点形状
    
    
    
    CGFloat lengths0[] = {2,1};
    
    CGContextRef Xline0 = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(Xline0, [UIColor blackColor].CGColor);
    CGContextSetLineWidth(Xline0,0.6);//线宽
    
    CGContextSetLineDash(Xline0, 1, lengths0, 2);  //画虚线
    CGContextMoveToPoint(Xline0, 0, 3.00*HEIGHT);    //开始画线
    CGContextAddLineToPoint(Xline0, 600.00*WEIGHT, 3.00*HEIGHT);
    CGContextStrokePath(Xline0);
    

    
    
    
*/
    
    UIImageView *renZhangIM = [[UIImageView alloc]init];
    renZhangIM.image = [UIImage imageNamed:@"yirenzheng240.png"];
    [self.contentView addSubview:renZhangIM];
    [renZhangIM mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.headImgeView.mas_bottom).offset(-25.00*HEIGHT);
        make.left.equalTo(self.headImgeView).offset((60.00*HEIGHT-45.00*WEIGHT)/2);
        make.size.mas_equalTo(CGSizeMake(45.00*WEIGHT, 48.00*HEIGHT));
        
    }];
    
    
    //根据数据判断男女图片
    UIImageView *XBimageView= [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"xingbei3p-01-01.png"]];
    [self.contentView addSubview:XBimageView];
    [XBimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.myBackimageView.mas_top).offset(13.00*HEIGHT);
        make.right.equalTo(renZhangIM.mas_right).offset(-1.00*WEIGHT);
        make.size.mas_equalTo(CGSizeMake(15.00*WEIGHT, 15.00*WEIGHT));
        
    }];

    
    
    
    
    
    
    _YHlabel = [[UILabel alloc]init];
    //    peopleL.backgroundColor = [UIColor redColor];
    _YHlabel.text = @"张三件丰";
    _YHlabel.alpha = 0.7;
    
    _YHlabel.textColor = [UIColor blackColor];
    _YHlabel.font = [UIFont systemFontOfSize:15.00*WEIGHT];
    [self.myBackimageView addSubview:_YHlabel];
    
    [_YHlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.headImgeView.mas_right).offset(25);
        make.height.mas_equalTo(25);
        make.top.mas_equalTo(self.myBackimageView.mas_top).offset(24);
        
    }];
    
    
//    UILabel *line1 = [[UILabel alloc]init];
//    line1.backgroundColor  = HS;
//    line1.alpha = 0.8;
//    [self.contentView addSubview:line1];
//    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
//        
//        make.top.equalTo(line.bottom).offset(38.00*HEIGHT/2);
//        make.left.equalTo(YHlabel.right).offset(6.00*WEIGHT/2);
//        //        make.right.equalTo(self.contentView.right).offset(-10.00*WEIGHT/2);
//        make.size.mas_equalTo(CGSizeMake(1,15.00*HEIGHT));
//        
//    }];
    _GSlabel = [[UILabel alloc]init];
    //    peopleL.backgroundColor = [UIColor redColor];
    _GSlabel.text = @"蓝觉公司";
    _GSlabel.textColor = [UIColor blackColor];
    _GSlabel.alpha = 0.5;
    _GSlabel.font = [UIFont systemFontOfSize:13.00*WEIGHT];
    [self.contentView addSubview:_GSlabel];
    [_GSlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_YHlabel.mas_bottom).offset(15.00*HEIGHT/2);
        make.left.equalTo(_YHlabel);
        make.size.mas_equalTo(CGSizeMake(_GSlabel.text.length*15.00*WEIGHT, 15.00*HEIGHT));

        
    }];
    
    
    
    
    
    UILabel *line2 = [[UILabel alloc]init];
    line2.backgroundColor  = HS;
    line2.alpha = 0.5;
    [self.contentView addSubview:line2];
    [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_GSlabel);
        make.left.mas_equalTo(_GSlabel.mas_right).offset(0 * AUTO_WIDTH);
        make.size.mas_equalTo(CGSizeMake(1, 15 * AUTO_HEIGHT));
        
    }];
    
    
    
    
    
    _DDlabe = [[UILabel alloc]init];
    //    peopleL.backgroundColor = [UIColor redColor];
    _DDlabe.text = @"浙江杭州萧山";
    _DDlabe.alpha= 0.5;
    _DDlabe.textColor = [UIColor blackColor];
    _DDlabe.font = [UIFont systemFontOfSize:13.00*WEIGHT];
    [self.myBackimageView addSubview:_DDlabe];
    [_DDlabe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_GSlabel);
        make.left.equalTo(line2.mas_right).offset(20.00*WEIGHT/2);
        make.size.mas_equalTo(CGSizeMake(_DDlabe.text.length*16.00*WEIGHT, 15.00*HEIGHT));

        
    }];

    
    
    
    
    
    
    
   
    
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
